package pt.mleiria.bit;

import org.apache.log4j.Logger;

public class BitWiseUtils {
	private static final Logger LOG = Logger.getLogger(BitWiseUtils.class);

	

	public static String formatByte(String str) {
		int numberOfBits = 8;
		String formattedByte = "";
		for (int i = 0; i < numberOfBits - str.length(); i++) {
			formattedByte += "0";
		}
		return formattedByte + str;
	}
	public static String paddTrailing(final int totalNumberOfBytes, final String binaryData){
		String padd = "";
		int bits = 8*totalNumberOfBytes;
		for(int i = 0; i < bits - binaryData.length(); i++){
			padd += "0";
		}
		return padd + binaryData;
	}
	
	

}
